using System.Data.Entity.ModelConfiguration;

namespace OBUCare.Core.Models.Mapping
{
    public class View_PartsStockDetailsMap : EntityTypeConfiguration<View_PartsStockDetails>
    {
        public View_PartsStockDetailsMap()
        {
            // Primary Key
            this.HasKey(t => new { t.ID});

            

            this.Property(t => t.PARTS_NAME)
                .HasMaxLength(50);

           

            this.Property(t => t.SUPPLIER_NAME)
                .IsRequired()
                .HasMaxLength(50);

   

            this.Property(t => t.SPEC_NAME)
                .IsRequired()
                .HasMaxLength(50);

          

      
            this.Property(t => t.CREATED_BY)
                .IsRequired()
                .IsFixedLength()
                .HasMaxLength(6);

            this.Property(t => t.OPERATOR_NAME)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("View_PartsStockDetails");
            this.Property(t => t.ID).HasColumnName("ID");
            this.Property(t => t.OWNER).HasColumnName("OWNER");
            this.Property(t => t.PARTS_ID).HasColumnName("PARTS_ID");
            this.Property(t => t.PARTS_NAME).HasColumnName("PARTS_NAME");
            this.Property(t => t.SUPPLIER_ID).HasColumnName("SUPPLIER_ID");
            this.Property(t => t.SUPPLIER_NAME).HasColumnName("SUPPLIER_NAME");
            this.Property(t => t.PARTS_SPEC_ID).HasColumnName("PARTS_SPEC_ID");
            this.Property(t => t.SPEC_NAME).HasColumnName("SPEC_NAME");
            this.Property(t => t.PARTS_COUNT).HasColumnName("PARTS_COUNT");
            this.Property(t => t.RECORD_DATE).HasColumnName("RECORD_DATE");
            this.Property(t => t.status).HasColumnName("status");
            this.Property(t => t.CREATED_BY).HasColumnName("CREATED_BY");
            this.Property(t => t.OPERATOR_NAME).HasColumnName("OPERATOR_NAME");
            this.Property(t => t.CREATED_DATE).HasColumnName("CREATED_DATE");
            this.Property(t => t.AGENT_NAME).HasColumnName("AGENT_NAME");
            this.Property(t => t.STOCK_TYPE).HasColumnName("STOCK_TYPE");
        }
    }
}
